Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lyskom-server-ceder-1616-generations-topgit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
be23e7f7
Commit
be23e7f7
authored
33 years ago
by
Per Cederqvist
Browse files
Options
Downloads
Patches
Plain Diff
First try.
parent
cf73de94
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/server/isc-malloc.c
+76
-0
76 additions, 0 deletions
src/server/isc-malloc.c
src/server/isc-malloc.h
+46
-0
46 additions, 0 deletions
src/server/isc-malloc.h
with
122 additions
and
0 deletions
src/server/isc-malloc.c
0 → 100644
+
76
−
0
View file @
be23e7f7
/*
* $Id: isc-malloc.c,v 1.1 1992/04/15 22:45:57 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
*
* LysKOM is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* LysKOM is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with LysKOM; see the file COPYING. If not, write to
* Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
* or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* Malloc wrappers for the isc package.
*
* These functions call smalloc and also counts
* how many allocated blocks there are.
*/
static
char
*
rcsid
=
"$Id: isc-malloc.c,v 1.1 1992/04/15 22:45:57 ceder Exp $"
;
#include
<stdio.h>
#include
<stddef.h>
#include
<server/smalloc.h>
#include
"log.h"
#include
"exp.h"
#include
"isc-malloc.h"
static
int
no_of_allocated_blocks
=
0
;
EXPORT
void
*
isc_malloc_wrapper
(
size_t
size
)
{
++
no_of_allocated_blocks
;
return
smalloc
(
size
);
}
EXPORT
void
isc_free_wrapper
(
void
*
ptr
)
{
--
no_of_allocated_blocks
;
sfree
(
ptr
);
}
EXPORT
void
*
isc_realloc_wrapper
(
void
*
ptr
,
size_t
size
)
{
if
(
ptr
==
NULL
)
return
isc_malloc_wrapper
(
size
);
return
srealloc
(
ptr
,
size
);
}
EXPORT
void
dump_isc_alloc_counts
(
FILE
*
stat_file
)
{
fprintf
(
stat_file
,
"---"
__FILE__
":
\n
"
"
\t
Allocated blocks by isc: %d
\n
"
,
no_of_allocated_blocks
);
}
This diff is collapsed.
Click to expand it.
src/server/isc-malloc.h
0 → 100644
+
46
−
0
View file @
be23e7f7
/*
* $Id: isc-malloc.h,v 1.1 1992/04/15 22:45:54 ceder Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
*
* LysKOM is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* LysKOM is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with LysKOM; see the file COPYING. If not, write to
* Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
* or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* $Id: isc-malloc.h,v 1.1 1992/04/15 22:45:54 ceder Exp $
*
* Malloc wrappers for the string package.
*
* These functions call smalloc and also counts
* how many allocated strings there are.
*/
extern
void
*
isc_malloc_wrapper
(
size_t
size
);
extern
void
isc_free_wrapper
(
void
*
ptr
);
extern
void
*
isc_realloc_wrapper
(
void
*
ptr
,
size_t
size
);
extern
void
dump_isc_alloc_counts
(
FILE
*
stat_file
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment