vmmap --summary X.memgraph
vmmap X.memgraph | rg "MEMORY REGION NAME"
vmmap --verbose X.memgraph | rg "MEMORYREGION"
leaks --traceTree 0xSTARTINGMEMORYADDRESS
malloc_history X.memgraph --fullStacks 0xSTARTINGMEMORYADRESS
- Other helpful commands
vmmap --pages X.memgraph
leaks X.memgraph
heap X.memgraph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- A concrete use case for the type which is to '(->)' as 'Day' is to '(,)'. | |
-- I call it "FunDay", but I don't know what its proper name is. I've been | |
-- trying to find a use for 'FunDay', and I think I've found a pretty neat one. | |
{-# LANGUAGE FlexibleContexts, FlexibleInstances, PolyKinds, RankNTypes, TypeSynonymInstances #-} | |
module Main where | |
import Test.DocTest | |
import Control.Monad.Except | |
import Control.Monad.Reader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Combine | |
import Foundation | |
import os | |
@MainActor public final class PollingDataModel<DataModels: Sendable> { | |
private let logger = Logger(subsystem: "Polling", category: "PollingDataModel") | |
private var pollingTask: Task<Void, Never>? | |
private var currentlyPolling = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension Task { | |
static func sleep(until target: Date) async throws where Success == Never, Failure == Never { | |
let duration = target.timeIntervalSinceNow | |
try await Self.sleep(for: .seconds(duration)) | |
} | |
} | |
print("Waiting for 1s...") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct ReducedReplayAsyncStream<Element> { | |
typealias Reduce = (_ partialResult: inout Element, _ nextResult: Element) -> Void | |
private let storage: _Storage | |
private var originalStream: AsyncStream<Element> | |
init( | |
bufferingPolicy limit: AsyncStream<Element>.Continuation.BufferingPolicy = .unbounded, | |
initialResult: Element, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Optional { | |
func map<T>( | |
transform: (Wrapped) async throws -> T | |
) async rethrows -> T? { | |
guard case let .some(value) = self else { return nil } | |
return try await transform(value) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Runs SwiftFormat on changed Swift files in the project. | |
# The re-formatting may not be caught at commit time, though, and so may require a subsequent commit/amending. | |
# If any command fails, exit immediately with that command's exit status. | |
# shellcheck disable=SC3040 | |
set -eo pipefail | |
# Redirect output to stderr. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Yoneda -------------------------------------------------------------- | |
newtype Yoneda f a = Yoneda { runYoneda :: forall b. ((a -> b) -> f b) } | |
instance Functor (Yoneda f) where | |
fmap f y = Yoneda (\ab -> runYoneda y (ab . f)) | |
toYoneda :: Functor f => f a -> Yoneda f a | |
toYoneda fa = Yoneda (\f -> fmap f fa) | |
fromYoneda :: Yoneda f a -> f a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension LinkerSetting { | |
static var mergeable: Self = unsafeFlags([ | |
"-Wl,-make_mergeable", | |
"-Wl,-no_exported_symbols", | |
]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.typescriptlang.org/play?#code/PTAEDMEMBsGcFNQAcBOB7JbYEsAu20A7UQUqIAoXATyUQBUUBXRAXlAcIGtC0B3QgbjJkQoXI0SoMWPAWKASogrVEAMRgJQrQvABu8FIOFgAItlgArdgGN8RUAEFQgCiJQAIUU1QAeRQAeOwBpXAD4NUDJQUAAfUABvUUgAcwAuUAAiaHhwXFT+UG0YJhSHAF8wiOi43ESU1JRsBIALbNz86ELXUGKDMnArG2IMrL8ggApW9rsAShTvP0CtXRQQmPDQFHhcBhRiSuq0wezA8cQusmKhXsJrWTX6pp8XUeOUl2mvXwW9QMfY1fXN7axeLJNJ1RqHPIFE6Cc49Po3eB4Bp6OauQIAYVGqzQKBmvgCwX82MIABlMrgUiNIEVJhoQuiiREiAAlO4U0AjABGL1pzHpRLe6N+fw2W2II1WTJQADoqgkNMxWOlyakyhF1QB+UBEMlZEY46XHWmS9UpFls-Uyo2rSYwoSGUDoogWK79eygQDkRK53Ig7IQACaon6sADaBJcAF1uiIAJIAWyQ0GwlkgbocAFoQm4qB540ggyFWFSaXTXAYRABRACODGwrXgV19oB8fO9OcQMfA4ALoRDeYLgX7LkCdiCUaEIgAcvAEqmbgBCOw+0CTtC4YahEYADxLrc++ntImU2BQsFwoFTuHgCfPuDQyHQ-oYlkQkBXM7nulESjhrpuUGwDJ-QAfS0BJgMva8kFwEZaRWVZLmuWxwBxHQUVHYt7Dgk1-jFCBUMWKlbVWUohAids0HAfD1kWVYRHVAA9DV7QiRC3X9NAGE5DJQJnYYRi7SkU2gaBOUgSwOEpaksNLfdeRCOSil+dVQBAE02JuHhIDwYCUJovRMKmFJ92UlS1lFQEtJ0vS0JQIjBBU2EVNwwEuxGKzcF0gi9GIiJznIpRKNADiuJ4sC6LARjmIiejsEQVd1wS4YgjI0AMnPaTCAYONOT0UIQu4+BeISEYOFLDgRg |
NewerOlder