summaryrefslogtreecommitdiff
path: root/src/common/ers.h
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-02 23:02:35 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-09-02 23:02:35 +0000
commitbc9bfc17f220f1eaecfe1515ceed6e75df2c30ef (patch)
tree763adac4b3eb2f949377eb1cdfd76debac2a664c /src/common/ers.h
parentc7a6884b345f7f8aaaf65c9529e1cfb8a04609d2 (diff)
downloadhercules-bc9bfc17f220f1eaecfe1515ceed6e75df2c30ef.tar.gz
hercules-bc9bfc17f220f1eaecfe1515ceed6e75df2c30ef.tar.bz2
hercules-bc9bfc17f220f1eaecfe1515ceed6e75df2c30ef.tar.xz
hercules-bc9bfc17f220f1eaecfe1515ceed6e75df2c30ef.zip
Hello! few things.
1) fixed bugreport:6603 - delayed clearunit now makes use of the ERS which is quite convenient for it speeds up due to the previous amount of mallocs that function would spend. 2) added extra debug information to the ERS system (before on any of its warnings we'd go OH MY GOD WHICH ONE OF THEM DID IT!!!), now upon allocation you give it a const, human-readable, name. 3) added support for options in the ERS system to save multiple/redudant processing in battle_delayed_damage and clif_clearunit_delayed and perhaps also in the future. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16736 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/ers.h')
-rw-r--r--src/common/ers.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/ers.h b/src/common/ers.h
index 9e120c313..249d325fd 100644
--- a/src/common/ers.h
+++ b/src/common/ers.h
@@ -70,6 +70,11 @@
# define ERS_ALIGNED 1
#endif /* not ERS_ALIGN_ENTRY */
+enum ERSOptions {
+ ERS_OPT_NONE = 0,
+ ERS_OPT_CLEAR = 1,/* silently clears any entries left in the manager upon destruction */
+};
+
/**
* Public interface of the entry manager.
* @param alloc Allocate an entry from this manager
@@ -121,7 +126,7 @@ typedef struct eri {
# define ers_entry_size(obj) (size_t)0
# define ers_destroy(obj)
// Disable the public functions
-# define ers_new(size) NULL
+# define ers_new(size,name) NULL
# define ers_report()
# define ers_force_destroy_all()
#else /* not DISABLE_ERS */
@@ -142,7 +147,7 @@ typedef struct eri {
* @param The requested size of the entry in bytes
* @return Interface of the object
*/
-ERS ers_new(uint32 size);
+ERS ers_new(uint32 size, char *name, enum ERSOptions options);
/**
* Print a report about the current state of the Entry Reusage System.