Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #341 (new wishlist)

Opened 17 years ago

Last modified 17 years ago

Marking functions that grow heap

Reported by: maxter Assigned to:
Priority: minor Milestone: Documentation
Component: Documentation Version:
Keywords: Cc:

Description

It would be really nice to have all (or most) function descriptions in the library tell the library user if the functions clean up after themselves (free heap objects manually or allocate objects only on stack). Then those who write real-time apps would know if it is safe to use a library function in their time-critical code when gc is disabled. Something like:

Grows heap (heap active, requires GC or whatever): yes/no/no, if provided a preallocated buffer.

I don't know if it's feasible at all.

Change History

05/12/07 17:49:47 changed by larsivi

  • owner deleted.
  • milestone set to Documentation.

07/22/07 13:05:53 changed by xammy

I've noticed this ticket and agree that some basic information about every function would be nice:

  • If/when it grows the heap
  • Complexity (thinking of all those standard datastructures which can find/delete/insert/update in O(1), O(n), O(n log n), etc.
  • Whether it's thread-safe

Maybe we might ask Walter if he can add those to the ddoc-specification?

Nice would be

/***********************************
 * foo does this.
 * Params:
 *	x =	is for this
 *		and not for that
 *	y =	is for that
 * Returns: The result.
 * Complexity: Linear in x and y.
 * ThreadSafe: Yes
 * HeapActivity: No
 */

bool foo(int x, int y)
{
   ...
}

What do you guys think about it?

07/25/07 21:14:27 changed by kris

Seems like a reasonable approach to me