Annotation of parser3/src/targets/isapi/pa_pool.C, revision 1.4
1.2 paf 1: /** @file
2: Parser: ISAPI memory manager impl.
3:
1.1 paf 4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.2 paf 5:
1.1 paf 6: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
7:
1.4 ! parser 8: $Id: pa_pool.C,v 1.3 2001/03/23 19:25:18 paf Exp $
1.1 paf 9: */
10:
11: #include <stdlib.h>
12:
13: #include "pa_pool.h"
1.3 paf 14: #include "pool_storage.h"
1.1 paf 15:
16: void *Pool::real_malloc(size_t size) {
1.3 paf 17: return fstorage?
18: static_cast<Pool_storage *>(fstorage)->malloc(size): ::malloc(size);
1.1 paf 19: }
20:
21: void *Pool::real_calloc(size_t size) {
1.3 paf 22: return fstorage?
23: static_cast<Pool_storage *>(fstorage)->calloc(size): ::calloc(size, 1);
1.1 paf 24: }
1.4 ! parser 25:
! 26: void Pool::register_cleanup(void (*cleanup) (void *), void *data) {
! 27: if(fstorage)
! 28: static_cast<Pool_storage *>(fstorage)->register_cleanup(cleanup, data);
! 29: else
! 30: Pool& pool=this;
! 31: PTHROW(0, 0,
! 32: 0,
! 33: "can not register cleanup on system pool");
! 34: }
E-mail: