Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Jaak Ristioja
OpenLDAP
Commits
34f068f1
Commit
34f068f1
authored
25 years ago
by
Juan Gomez
Browse files
Options
Downloads
Patches
Plain Diff
Drop support for alloca().
parent
2cb228a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ac/alloca.h
+2
-0
2 additions, 0 deletions
include/ac/alloca.h
libraries/libldbm/ldbm.c
+17
-5
17 additions, 5 deletions
libraries/libldbm/ldbm.c
with
19 additions
and
5 deletions
include/ac/alloca.h
+
2
−
0
View file @
34f068f1
...
...
@@ -12,6 +12,8 @@
#ifndef _AC_ALLOCA_H
#define _AC_ALLOCA_H
#error "alloca() not supported, use malloc()"
/* AIX requires this to be the first thing in the file. */
#ifdef __GNUC__
# define alloca __builtin_alloca
...
...
This diff is collapsed.
Click to expand it.
libraries/libldbm/ldbm.c
+
17
−
5
View file @
34f068f1
...
...
@@ -553,7 +553,6 @@ ldbm_errno( LDBM ldbm )
/* MMAPED DBM HASHING DATABASE */
#include
<ac/alloca.h>
#include
<ac/string.h>
/* #define MDBM_DEBUG */
...
...
@@ -690,7 +689,7 @@ ldbm_fetch( LDBM ldbm, Datum key )
#ifdef NO_NULL_KEY
k
.
key
.
dsize
=
key
.
dsize
+
1
;
k
.
key
.
dptr
=
alloc
a
(
k
.
key
.
dsize
);
k
.
key
.
dptr
=
m
alloc
(
k
.
key
.
dsize
);
*
(
k
.
key
.
dptr
)
=
'l'
;
memcpy
(
(
void
*
)(
k
.
key
.
dptr
+
1
),
key
.
dptr
,
key
.
dsize
);
#else
...
...
@@ -730,6 +729,10 @@ ldbm_fetch( LDBM ldbm, Datum key )
/* LDBM_UNLOCK; */
#ifdef NO_NULL_KEY
free
(
k
.
key
.
dptr
);
#endif
return
d
;
}
/* Datum ldbm_fetch() */
...
...
@@ -754,7 +757,7 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags )
#ifdef NO_NULL_KEY
int_key
.
dsize
=
key
.
dsize
+
1
;
int_key
.
dptr
=
alloc
a
(
int_key
.
dsize
);
int_key
.
dptr
=
m
alloc
(
int_key
.
dsize
);
*
(
int_key
.
dptr
)
=
'l'
;
/* Must not be NULL !*/
memcpy
(
(
void
*
)(
int_key
.
dptr
+
1
),
key
.
dptr
,
key
.
dsize
);
#else
...
...
@@ -773,6 +776,10 @@ ldbm_store( LDBM ldbm, Datum key, Datum data, int flags )
fflush
(
stdout
);
#endif
#ifdef NO_NULL_KEY
free
(
int_key
.
dptr
);
#endif
return
(
rc
);
}
/* int ldbm_store() */
...
...
@@ -790,7 +797,7 @@ ldbm_delete( LDBM ldbm, Datum key )
#ifdef NO_NULL_KEY
int_key
.
dsize
=
key
.
dsize
+
1
;
int_key
.
dptr
=
alloc
a
(
int_key
.
dsize
);
int_key
.
dptr
=
m
alloc
(
int_key
.
dsize
);
*
(
int_key
.
dptr
)
=
'l'
;
memcpy
(
(
void
*
)(
int_key
.
dptr
+
1
),
key
.
dptr
,
key
.
dsize
);
#else
...
...
@@ -800,6 +807,9 @@ ldbm_delete( LDBM ldbm, Datum key )
rc
=
mdbm_delete
(
ldbm
,
int_key
);
/* LDBM_UNLOCK; */
#ifdef NO_NULL_KEY
free
(
int_key
.
dptr
);
#endif
return
(
rc
);
...
...
@@ -825,7 +835,7 @@ ldbm_get_next( LDBM ldbm, kvpair (*fptr)(MDBM *, kvpair) )
/* LDBM_LOCK; */
in
.
key
.
dsize
=
sz
;
/* Assume first key in one pg */
in
.
key
.
dptr
=
alloc
a
(
sz
);
in
.
key
.
dptr
=
m
alloc
(
sz
);
in
.
val
.
dptr
=
NULL
;
/* Don't need data just key */
in
.
val
.
dsize
=
0
;
...
...
@@ -853,6 +863,8 @@ ldbm_get_next( LDBM ldbm, kvpair (*fptr)(MDBM *, kvpair) )
}
/* LDBM_UNLOCK; */
free
(
in
.
key
.
dptr
);
return
ret
;
...
...
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