View OwnershipTLDR.md

Swift Ownership Manifesto TL;DR

Most of the manifesto is background and detailed definitions -- if you're confused or want details, read the manifesto!

https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170213/032155.html

Note also that manifestos aren't complete proposals -- syntax and details may change!

One piece of background: inout is kinda complicated because it can be used on computed properties -- foo(&val.x) might be sugar for

View raw_entry.rs
use std::collections::hash_map::DefaultHasher;
use std::hash::{BuildHasherDefault, Hasher};
use std::cell::Cell;
// Use `BuildHasherDefault` to get deterministic hashing between map instances
type SimpleMap<K, V> = HashMap<K, V, BuilderHasherDefault<DefaultHasher>>;
/// A very naively memoized string
pub struct MemoizedString {
string: String,
View cbindgen.diff
diff --git a/gfx/webrender_bindings/cbindgen.toml b/gfx/webrender_bindings/cbindgen.toml
index bd7a039..9dc1102 100644
--- a/gfx/webrender_bindings/cbindgen.toml
+++ b/gfx/webrender_bindings/cbindgen.toml
@@ -30,7 +30,7 @@ derive_eq = true
[enum]
add_sentinel = true
-# derive_helper_methods = true
+derive_helper_methods = true
View patch.diff
From d9b0ed8270a907c0c8703ffc9d11ef5720eeac38 Mon Sep 17 00:00:00 2001
From: Alexis Beingessner <a.beingessner@gmail.com>
Date: Tue, 24 Apr 2018 23:11:45 -0400
Subject: [PATCH] Bug 1430869 - add reftest for border collapse and captions.
r?mstange
MozReview-Commit-ID: JBN8p3j5rVJ
---
layout/reftests/bugs/1430869-ref.html | 37 ++++++++++++++++++++++++++++++++
layout/reftests/bugs/1430869.html | 40 +++++++++++++++++++++++++++++++++++
View patch.diff
From ee0290da283df0cfff74cd24f02066386194f9d8 Mon Sep 17 00:00:00 2001
From: Alexis Beingessner <a.beingessner@gmail.com>
Date: Tue, 10 Apr 2018 15:43:35 -0400
Subject: [PATCH] adjust test expectations (passes and fuzzy reductions) for
blob-invalidation
---
image/test/reftest/downscaling/reftest.list | 2 +-
layout/reftests/invalidation/reftest.list | 8 ++++----
layout/reftests/text-svgglyphs/reftest.list | 2 +-
View log.txt
Alexis Beingessner@DESKTOP-M6UNB64 /c/gecko
$ ./mach talos-test --activeTests tp5o_scroll
16:57:34 INFO - MultiFileLogger online at 20180404 16:57:34 in c:\gecko
16:57:34 INFO - Run as ./mach talos-test --activeTests tp5o_scroll
16:57:34 INFO - Dumping config to c:/gecko\testing\mozharness\logs\localconfig.json.
16:57:34 INFO - {'append_to_log': False,
16:57:34 INFO - u'base_work_dir': u'c:/gecko\\testing\\mozharness',
16:57:34 INFO - u'binary_path': u'c:/gecko/obj-i686-pc-mingw32\\dist\\bin\\firefox.exe',
16:57:34 INFO - 'code_coverage': False,
16:57:34 INFO - u'default_actions': (u'populate-webroot',
View log.txt
$ ./mach talos-test --activeTests tp5o_scroll --geckoProfile
16:46:08 INFO - MultiFileLogger online at 20180404 16:46:08 in c:\gecko
16:46:08 INFO - Run as ./mach talos-test --activeTests tp5o_scroll --geckoProfile
16:46:08 INFO - Dumping config to c:/gecko\testing\mozharness\logs\localconfig.json.
16:46:08 INFO - {'append_to_log': False,
16:46:08 INFO - u'base_work_dir': u'c:/gecko\\testing\\mozharness',
16:46:08 INFO - u'binary_path': u'c:/gecko/obj-i686-pc-mingw32\\dist\\bin\\firefox.exe',
16:46:08 INFO - 'code_coverage': False,
16:46:08 INFO - u'default_actions': (u'populate-webroot',
16:46:08 INFO - u'create-virtualenv',
View nsDisplayList.cpp
bool
nsDisplayMask::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
mozilla::wr::IpcResourceUpdateQueue& aResources,
const StackingContextHelper& aSc,
mozilla::layers::WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder)
{
bool snap;
float appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
nsRect displayBound = GetBounds(aDisplayListBuilder, &snap);
View notes.md

Background

methods like push on Vec don't provide anyway for the caller to handle OOM. (I will be using push as substitute for "all allocating APIs" for simplicity here)

  • Today we always abort.
  • Moving to unwinding is problematic
    • unsafe code may be exception unsafe on the basis of current strategy
View gist:cdc2ebf961bda98fcb4c2bbfe88c1454
RectWithSize device_rect = prim.local_clip_rect;
device_rect.p0 -= prim.task.content_origin;
device_rect.p0 *= uDevicePixelRatio;
device_rect.size *= uDevicePixelRatio;
vec2 local_pos = prim.task.common_data.task_rect.p0 +
clamp_rect(
glyph_pos * res.scale + uDevicePixelRatio * (glyph.offset - prim.task.content_origin),
device_rect);