



MM_STRING.nxc
MM_MM_ID.nxc
MM_op.nxc
MM_convert.nxc
An entry in MM_new() and MM_sizeOf() for MM_ID_TYPE_STRING and MM_ID_TYPE_MM_ID... Anything else?





Reasons to use:
	-Pseudo-Doubles
	-Pseudo-Pointers
		-Linked lists
		-Trees
		-etc
	-Pseudo-Function Pointers??
	-Hashes
	-Parser (with "variables" using hashes)
	-Pseudo-Dynamic Typing
	-Pseudo-Function overloading
	-Pseudo-Operator overloading??



To Do:
	-Comments in MM_delete and MM_deleteArr. Copy them from MM_new?

	-Pre-allocation

	-unsigned long == PTR? (In some cases)
	-Adding/Subtracting/Multiplying/Dividing/Modulo/Manipulating/etc LONGs, ULONGs, (IEEE-754) 32-bit FLOATs, (IEEE-754) 64-bit DOUBLEs.

	-Floats!
	-Doubles! (*shudders*)
	-Strings

	Pointers! (to pointers?)
	Function Pointers


Done:
	Store MM_garbage[] as MM_ID_TYPE_BYTE entries only?
	Merges garbage entries; add new function or implement in MM_garbage_optimize()


Retarded ideas:
	Mutexes (uh... how?! And what's the point!?)
	Structs (possibly insane)
	Classes (are you insane?)


Bugs:
	Possible Bugs (see how awesome I am? I *predict* bugs!):
		The &s. Remove unnecessary ones. For example, the &out = MM_ID_NULL may change the values of MM_ID_NULL!!!!

	Report NXC Bug. Can't use "MM_ID ptr = myvar;"


Problem solving:
	-safecalls/inlines on MM functions won't prevent two the values/sizes of MM_garbage/MM_garbage_len/etc from being changed, and may cause undefined behaviour if two functions that manipulate the same thing (MM_garbage/etc) are called at once. Perhaps a MM_mutex that is Acquired() whenever a function using MM is called? Use this in addition to safecalls/inlines. Applies to BOTH read and/or write MM functions.
	-Isn't there any way to prevent execution of MM functions until the "root" function is done? Perhaps by passing a if called by "root" function. But this would only work on inline functions, since the "safecall" in a already running "sub-"function will prevent the "root->sub" function from running.
	-EDIT: What if a function calls another function? Hmm... the only solution will be to use defines with lots of Acquires() and Releases() at the task level? Or force the user to do this themselves...
	-EDIT 2: Possibly use a #define with
		#define func(args) \
		Acquire(MM_mutex); \
		MM_func(args); \
		Release(MM_mutex);
	-That approach only works with voids... and only partially...
-Solution: Use inline functions with:
		inline <type> <func>(args)
		{
			Acquire(MM_mutex);
			MM_<func>(args);
			Release(MM_mutex);
		}
	and tell the user to use the <func>s, but inside MM_<func>s, you can call using other <func>s. This works! ... I think. And it doesn't increase number of functions used, since it's inline.
		<type> MM_<func>(args)
		{
			// ...
			int foo = MM_<func2>(args2);
		}

	-The naming scheme isn't too great. Perhaps this should be used:
		inline <type> <func>(args)
		{
			Acquire(MM_mutex);
			__<func>(args);
			Release(MM_mutex);
		}
	i.e. The "MM_" part is in <func>